package com.example.demo20230927;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class TaskService {

    @Autowired
    private TaskMapper taskMapper;

    @Transactional(readOnly = true)
    public List<Task> getTasksByUserId(Integer userId) {
        return taskMapper.findByUserId(userId);
    }
}
